package com.econ.powercloud.ems.common.enums;

/**
 * @Author : zjf
 * @Description : 电价模型-> 电价类型
 * @Date : 2022/10/18 14:06
 * @Modified by : zjf
 */
public enum PriceType implements EnumMethod{

    GENERAL_INDUSTRY_PRICE(0,"一般工商业电价"),
    BIG_INDUSTRY_PRICE(1,"大工业电价"),
    ;

    private Integer code;
    private String desc;

    @Override
    public Integer getCode() {
        return code;
    }

    @Override
    public String getDesc() {
        return desc;
    }

    PriceType(int code, String desc){
        this.code=code;
        this.desc=desc;
    }

    public static String getDescFromCode(int code){
        for(PriceType type: PriceType.values()){
            if(type.getCode() == code){
                return type.getDesc();
            }
        }
        return null;
    }
}
